package ui.panel;

import cerebrum.common.ImagesDataLoaderUtil;
import cerebrum.crawler.VerseWebCrawler;
import com.sun.jna.Native;
import com.sun.jna.Structure;
import com.sun.jna.platform.win32.User32;
import com.sun.jna.win32.W32APIOptions;

import java.awt.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Test1 {
    /**
     * @param args the command line arguments
     */

//    public static void main(String[] args) throws Exception {
//        List<List<String>> verseMsgs = VerseWebCrawler.getVerseMsgs("清明节");
//        System.out.println(verseMsgs);
//
//    }
    public static void main(String[] args) throws InterruptedException {
        long idleTime = 0 ;
        long start = System.currentTimeMillis();
        Point currLocation = MouseInfo.getPointerInfo().getLocation();
        while(true){
            Thread.sleep(1000);
            Point newLocation = MouseInfo.getPointerInfo().getLocation();
            if(newLocation.equals(currLocation)){
                //not moved
                idleTime = System.currentTimeMillis() - start;
            } else{
                System.out.printf("Idle time was: %s ms", idleTime);
                System.out.println("\n");
                idleTime=0;
                start =  System.currentTimeMillis();
            }
            currLocation = newLocation;

        }
    }


}


